package redis

import (
	"fmt"
	redis2 "github.com/gomodule/redigo/redis"
)

type set struct {
	conn redis2.Conn
}

func (redisSet *set) Set(key string, args ...interface{}) {
	arg := append([]interface{}{key}, args...)
	_, err := redisSet.conn.Do("sadd", arg...)
	if err != nil {
		fmt.Println(err.Error())
	}
	defer redisSet.conn.Close()
}

func (redisSet *set) Exists(key string, value interface{}) bool {
	rep, _ := redisSet.conn.Do("sismember", []interface{}{key, value}...)
	defer redisSet.conn.Close()
	if rep.(int64) == 1 {
		return true
	}
	return false
}

func (redisSet *set) Get(key, value string) {

}
